<%@ page language="java" pageEncoding="utf-8"%>
<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type='text/javascript' src='dwr/engine.js'></script>
		<script type='text/javascript' src='dwr/util.js'></script>
		<script type='text/javascript' src='js/Ajax.js'></script>
  </head>
  <body>
  	<a href="${ctx}/pages/safeai/jsp/product/catalogManage.jsp">to tree</a>
  		<a href="${ctx}/shopping/viewShoppingCart.do?m=addProductForward&id=2467&number=1" target="shoppingCart">2467</a>
  <a href="${ctx}/shopping/viewShoppingCart.do?m=addProductForward&id=1967&number=1" target="shoppingCart">1967</a>
  <a href="${ctx}/shopping/viewShoppingCart.do?m=addProductForward&id=1999&number=1" target="shoppingCart">1999</a>
  
  <p>前台管理</p>
  	<a href="${ctx}/others/activityManage.do?method=list">活动管理 Activity</a></br>
  	<a href="${ctx}/others/announcementManage.do?method=list">公告管理 Announcement</a></br>
  	<a href="${ctx}/others/evaluateManage.do?method=listToday">评论管理 evaluate</a></br>
  	<a href="${ctx}/others/messageManage.do?method=list">建议中心管理message</a></br>
  	<a href="${ctx}/others/lackManage.do?method=list">缺货登记管理lack</a></br>
  	<a href="${ctx}/others/linkManage.do?method=list">友情连接管理link</a></br>
  	
 <p>广告管理</p>
    生成广告文件 
    <a href="${ctx}/others/firstAdvertisingManage.do?method=firstAdvertisingMessage">修改动态广告位内容</a>
    编辑广告文件 
    修改广告位内容 
    修改动态广告位内容 
 
 
 <p>系统管理</p>
    系统配置 
    内容管理 
    <a href="${ctx}/others/adManage.do?method=fileList">文件管理 </a><br/>
    管理员管理(不用我做)
 
 <p>个人菜单</p> 
    重新登陆 
 
 
 <p>商品预定子系统</p> 
    预定信息登记 
    预定信息查看 
    预定信息查询 
    预定活动管理 
 
 
 <p>咨询管理</p>
 <a href="${ctx}/others/myMessageManage.do?method=act">咨询活动管理</a></br>
 
 <p>新增功能</p>
 <a href="${ctx}/others/voteManage.do?method=list">投票管理vote</a></br>
    商品咨询管理 </br>
 <a href="${ctx}/others/usermsgManage.do?method=indict">投诉管理usermsg INDICT</a></br>  
 <a href="${ctx}/others/usermsgManage.do?method=advice">建议管理usermsg ADVICE</a></br> 
 <a href="${ctx}/others/usermsgManage.do?method=quest">举报管理usermsg QUEST</a></br> 
 <a href="${ctx}/others/usermsgManage.do?method=offer">提问管理usermsg OFFER</a></br> 
    广告位注册 
    商品自由项定义 
    <br/>
    省：<select id="provinces"></select>市：<select id="citys"></select>区：<select id="villages"></select><br/>
    
    省：<select name="pp" id="pp1">
    <option>1</option>
    <option>1</option>
    </select>
    省：<select name="pp" id="pp2"><option>2</option><option>2</option></select>
    省：<select name="pp" id="pp3"><option>3</option><option>3</option></select>
    
  </body>
  <script type="text/javascript">
    var provinces11=document.getElementById("provinces");
    var citys11=document.getElementById("citys");
    var villages11=document.getElementById("villages");
  window.onload=function(){
  var ajax=new Ajax();
  function _backaa(test){
  }
  ajax.ajaxRequest("${ctx}/order/cityOreder.do","method=getAllProvince","get",_backaa);
  
  
  var pp=document.getElementsByName("pp");
  for(var i=0;i<pp.length;i++){
     pp[i].onchange=function(){
        alert(this.id+" :"+this.options[this.selectedIndex].value);
     }
  }
  
  
    getAllProvince();
    
    provinces11.onchange=function(){
      getAllCity();
    }
    citys11.onchange=function(){
      getAllVillage();
    }
  }
  

    
  
  
  var xhr = false;
  //获得ajax连接
  function getXhr(){        
        this.xhr = false;
        if(!xhr){        
	        if (window.XMLHttpRequest) {
	            xhr = new XMLHttpRequest();
	            if (xhr.overrideMimeType) {
	                xhr.overrideMimeType('text/xml');
	            }
	        } else if (window.ActiveXObject) {
	            try {
	                xhr = new ActiveXObject("Msxml2.XMLHTTP");
	            } catch (e) {
	                try {
	                    xhr = new ActiveXObject("Microsoft.XMLHTTP");
	                } catch (e) {
	                    xhr=false;
	                }
	            }
	        }
        }
        if (!xhr) {
            alert('您目前的配置不能运行现在的脚本！');
            return false;
        }
            return xhr;
  }
  
  //要调用的url 是否同步 回调函数方法名
  function ajax(url,isboolean,methods){
        this.getXhr();
        if(!xhr){
            return;
        } 
        //一般用true
        xhr.open('GET', url, isboolean);
        xhr.onreadystatechange = methods;
        //设置可以重复提交，不使用缓存
        xhr.setRequestHeader("If-Modified-Since","0");        
        xhr.send(null);
  }
  //查询所有省
  function getAllProvince(){  
      this.ajax('${ctx}/order/cityOreder.do?method=getAllProvince',true,backProvince);
  }
  //查询指定省下所有城市
  function getAllCity(){
      var province=document.getElementById("provinces");
      var provinceName=province.options[province.selectedIndex].value;
      this.ajax('${ctx}/order/cityOreder.do?method=getCitys&provinceName='+encodeURI(provinceName),true,backCity);
  }
  //查询指定省和城市下所有区域
  function getAllVillage(){
      var province=document.getElementById("provinces");
      var provinceName=province.options[province.selectedIndex].value;
      var city=document.getElementById("citys");
      var cityName=city.options[city.selectedIndex].value;
      this.ajax('${ctx}/order/cityOreder.do?method=getVillages&provinceName='+encodeURI(provinceName)+'&cityName='+encodeURI(cityName),true,backVillage);
  }
  //添加省
  function backProvince(){
            if (xhr.readyState == 4) {
            if (xhr.status == 200) {
                var ps=xhr.responseText;
                var list=ps.split(",");
                DWRUtil.removeAllOptions("provinces");
	            DWRUtil.addOptions("provinces", list);
	            getAllCity();
            } else {
                alert("服务器端异常！");
            }
        }
  }
  //添加市
  function backCity(){
            if (xhr.readyState == 4) {
            if (xhr.status == 200) {
                var ps=xhr.responseText;
                var list=ps.split(",");
                DWRUtil.removeAllOptions("citys");
	            DWRUtil.addOptions("citys", list);
	            getAllVillage();
            } else {
                alert("服务器端异常！");
            }
        }
  }
  
  //添加区
  function backVillage(){
            if (xhr.readyState == 4) {
            if (xhr.status == 200) {
                var ps=xhr.responseText;
                var list=ps.split(",");
                DWRUtil.removeAllOptions("villages");
	            DWRUtil.addOptions("villages", list);
	            
            } else {
                alert("服务器端异常！");
            }
        }
  }
  </script>
</html>
